/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "Car")
@NamedQueries({
    @NamedQuery(name = "Car.findAll", query = "SELECT c FROM Car c"),
    @NamedQuery(name = "Car.findByCarID", query = "SELECT c FROM Car c WHERE c.carID = :carID"),
    @NamedQuery(name = "Car.findByCapacity", query = "SELECT c FROM Car c WHERE c.capacity = :capacity"),
    @NamedQuery(name = "Car.findByMode", query = "SELECT c FROM Car c WHERE c.mode = :mode"),
    @NamedQuery(name = "Car.findByPriceDate", query = "SELECT c FROM Car c WHERE c.priceDate = :priceDate"),
    @NamedQuery(name = "Car.findByPriceHourPenalty", query = "SELECT c FROM Car c WHERE c.priceHourPenalty = :priceHourPenalty"),
    @NamedQuery(name = "Car.findByQty", query = "SELECT c FROM Car c WHERE c.qty = :qty"),
    @NamedQuery(name = "Car.findByDescription", query = "SELECT c FROM Car c WHERE c.description = :description"),
    @NamedQuery(name = "Car.findByImageurl", query = "SELECT c FROM Car c WHERE c.imageurl = :imageurl"),
    @NamedQuery(name = "Car.findByStatus", query = "SELECT c FROM Car c WHERE c.status = :status")})
public class Car implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "carID")
    private Integer carID;
    @Column(name = "capacity")
    private Integer capacity;
    @Column(name = "mode")
    private String mode;
    @Column(name = "priceDate")
    private BigDecimal priceDate;
    @Column(name = "priceHourPenalty")
    private BigDecimal priceHourPenalty;
    @Column(name = "qty")
    private Integer qty;
    @Column(name = "description")
    private String description;
    @Column(name = "imageurl")
    private String imageurl;
    @Column(name = "status")
    private Boolean status;
    @OneToMany(mappedBy = "car")
    private List<CarBooking> carBookingList;

    public Car() {
    }

    public Car(Integer carID) {
        this.carID = carID;
    }

    public Integer getCarID() {
        return carID;
    }

    public void setCarID(Integer carID) {
        this.carID = carID;
    }

    public Integer getCapacity() {
        return capacity;
    }

    public void setCapacity(Integer capacity) {
        this.capacity = capacity;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public BigDecimal getPriceDate() {
        return priceDate;
    }

    public void setPriceDate(BigDecimal priceDate) {
        this.priceDate = priceDate;
    }

    public BigDecimal getPriceHourPenalty() {
        return priceHourPenalty;
    }

    public void setPriceHourPenalty(BigDecimal priceHourPenalty) {
        this.priceHourPenalty = priceHourPenalty;
    }

    public Integer getQty() {
        return qty;
    }

    public void setQty(Integer qty) {
        this.qty = qty;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImageurl() {
        return imageurl;
    }

    public void setImageurl(String imageurl) {
        this.imageurl = imageurl;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public List<CarBooking> getCarBookingList() {
        return carBookingList;
    }

    public void setCarBookingList(List<CarBooking> carBookingList) {
        this.carBookingList = carBookingList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (carID != null ? carID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Car)) {
            return false;
        }
        Car other = (Car) object;
        if ((this.carID == null && other.carID != null) || (this.carID != null && !this.carID.equals(other.carID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.Car[carID=" + carID + "]";
    }

}
